package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
//从文件中读取数据
public class FisDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("fos.dat");

        int d = fis.read();
        System.out.println(d);//1

        d = fis.read();
        System.out.println(d);//2

        d = fis.read();
        System.out.println(d);//-1,表示读取到了末尾
        fis.close();
    }
}
